
import React, {useState} from 'react';  
import { useAtom } from 'jotai';  
import { countAtom } from './atoms'; // 确保路径正确  

const App: React.FC = () => { // 这里声明组件类型为 React.FC  
    const [count, setCount] = useAtom(countAtom); // useAtom 返回的类型已被 TypeScript 获取  

    return (  
        <div>  
            <h1>Count: {count}</h1>  
            <button onClick={() => setCount(count + 1)}>Increment</button>  
        </div>  
    );  
};  

export default App;  